package com.pr.util;


import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;

/**
 * @Author matengfei
 * @Date 2024/7/16 20:29
 * @PackageName:com.pr.util
 * @ClassName: Idempotent
 * @Description: 幂等工具类
 * @Version 1.0
 */
public class IdempotentUtil {
    private static Table<Class<?>,String,Long> map = HashBasedTable.create();

    /**
     * @Description:
     * @param clazz：类似于x坐标
     * @param xid：类似于y坐标
     * @param value：键对应的属性值
     * @return void
     */
    public static void add(Class<?> clazz,String xid,Long value){
        map.put(clazz, xid, value);
    }

    public static Long get(Class<?> clazz,String xid){
        return map.get(clazz, xid);
    }

    public static void remove(Class<?> clazz,String xid){
        map.remove(clazz,xid);
    }
}
